package com.foreknow.demo11;

public class Test2 {
    public static void main(String[] args) {
        String s1 = "haha";
        String s2 = "haha";
        String s3 = new String("haha");
        String s4 = new String("haha");
        String s5 = "ha" + "ha";
        String s6 = new String("ha")+"ha";

        System.out.println(s1 == s2); //true  在字符串中比较的内存地址
        System.out.println(s1 == s3); //false;
        System.out.println(s1 == s5); //true
        System.out.println(s3 == s4);//false;
    }
}
